﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;

namespace MvcMovie.Models
{
    public class Movie
    {
        public int ID { get; set; }
        [Required]
        [Display(Name = "标题")]
        public string Title { get; set; }
        [DataType(DataType.Date)]
        [DisplayFormat(DataFormatString = "{0:d}")]
        [Display(Name = "发布时间")]
        public DateTime ReleaseDate { get; set; }
        [Required]
        //[Display(Name = "发布时间")]
        public string Genre { get; set; }
        [Range(1, 100)]
        [DataType(DataType.Currency)]
        [DisplayFormat(DataFormatString = "{0:c}")]
        [Display(Name = "价格")]
        public decimal Price { get; set; }
        [StringLength(5)]
       // [Display(Name = "发布时间")]
        public string Rating { get; set; }
    }
    public class MovieDBContext : DbContext
    {
        public MovieDBContext()
            : base("DefaultConnection")
        {
        }
        public DbSet<Movie> Movies { get; set; }
    }
}